<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html ng-app="LeaderboardApp">
<head>
<meta charset="UTF-8">
<title>Configuración de Datos Cargados</title>
<link href="/Leaderboard/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="/Leaderboard/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css"/>
<link href="/Leaderboard/css/styles.css" rel="stylesheet" type="text/css"/>

<script type="text/javascript" src="/Leaderboard/js/lib/bootstrap/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="/Leaderboard/js/lib/bootstrap/respond.min.js"></script>
<script type="text/javascript" src="/Leaderboard/js/lib/bootstrap/bootstrap.min.js"></script>

<!--[if lt IE 9]><script type="text/javascript" src="/Leaderboard/js/lib/angularjs/html5shiv-printshiv.min.js"></script><![endif]-->
<!--[if lt IE 8]><script type="text/javascript" src="/Leaderboard/js/lib/angularjs/json3.min.js"></script><![endif]-->

<script type="text/javascript" src="/Leaderboard/js/lib/angularjs/angularjs-1.2.16.min.js"></script>
<script type="text/javascript" src="/Leaderboard/js/controllers.init.js"></script>
<script type="text/javascript" src="/Leaderboard/js/controllers.admin.js"></script>
<script type="text/javascript" src="/Leaderboard/js/controllers.uploads.js"></script>

<!--[if lte IE 8]>
<script type="text/javascript">
    $(document).ready(function() {
        angular.bootstrap(document);
    });
</script>
<![endif]-->
</head>
<body ng-controller="uploadsCtrl" ng-init="">
	<div ng-include="'/Leaderboard/include/header.html'"></div>
	
	<div class="container">
		<div ng-include="'/Leaderboard/include/changePassword.html'"></div>
		<div ng-include="'/Leaderboard/include/messages.html'"></div>
	
		<div class="panel panel-primary">
			<div class="panel-heading"><h3 class="panel-title">Datos Cargados del Archivo</h3></div>
			<div class="panel-body panel-body-scrollable">
				<form id="importDataForm" name="importDataForm" role="form">
					<table class="table table-striped table-condensed table-bordered" ng-table="tableParams">
						<thead>
							<tr><th ng-repeat="column in selectedColumns track by $index">Columna {{$index+1}} 
									<div><select ng-model="selectedColumns[$index]" ng-options="val for val in dataColumns" required></select></div></th>
								<th>Acciones</th><th>Resultado</th></tr></thead>
						<tbody><tr ng-repeat="upload in uploadedContent track by $index" ng-class="classForRow(upload, insertResults[$index])">
							<td ng-repeat="column in upload.columns track by $index">{{column}}</td>
							<td>
								<span ng-show="upload.discarded">Descartada</span>
								<a class="link fixed-width" href="javascript:void(0);" ng-click="discardRow(upload)" ng-hide="upload.discarded">Descartar</a>
							</td>
							<td>{{insertResults[$index]}}</td>
						</tr></tbody>
					</table>
				</form>
			</div>
			<div class="panel-footer">
				<button type="button" class="btn btn-default" ng-click="goBack()">Regresar</button>
				<button type="button" class="btn btn-primary" ng-click="insertRows()" ng-disabled="loading || importDataForm.$invalid">Agregar registros</button>
			</div>
		</div>
	</div>
	
</body>
</html>